{php include wl_template('common/header');}
<style>
    .change:hover{
        cursor:pointer;
    }
</style>
<ul class="nav nav-tabs">
	<li {if $type == 0} class="active" {/if}><a href="{php echo web_url('agentset/agentSetTags/tags',array('type'=>0))}">商户标签</a></li>
	<li {if $type == 1} class="active" {/if}><a href="{php echo web_url('agentset/agentSetTags/tags',array('type'=>1))}">抢购标签</a></li>
	<li {if $type == 2} class="active" {/if}><a href="{php echo web_url('agentset/agentSetTags/tags',array('type'=>2))}">拼团标签</a></li>
	{if p('groupon')}
	<li {if $type == 3} class="active" {/if}><a href="{php echo web_url('agentset/agentSetTags/tags',array('type'=>3))}">团购标签</a></li>
	{/if}
    {if p('bargain')}
    <li {if $type == 4} class="active" {/if}><a href="{php echo web_url('agentset/agentSetTags/tags',array('type'=>4))}">砍价标签</a></li>
    {/if}
</ul>
<div class="app-content">
    <div class="app-filter">
        <div class="filter-action">
            <a href="{php echo web_url('agentset/agentSetTags/tagsedit')}" class="btn btn-primary">添加标签</a>
        </div>
    </div>
    <div class="app-table-list">
        <div class="panel panel-default">
            <div class="table-responsive">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th class="text-center" width="5%">id</th>
                            <th class="text-center" width="20%">标题(点击编辑)</th>
                            <th class="text-center" width="20%">排序(点击编辑)</th>
                            <th class="text-center" width="15%">状态(点击修改)</th>
                            <th class="text-center" width="20%">标签类型</th>
                            <th class="text-center" width="15%">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {loop $tags $tag}
                        <tr class="text-center">
                            <td>{$tag['id']}</td>
                            <td><a data-href="{php echo web_url('agentset/agentSetTags/changeinfo',array('id' => $tag['id'],'type'=>1))}" href="javascript:;" title="修改标签" data-toggle="ajaxEdit" >{$tag['title']}</a></td>
                            <td><a data-href="{php echo web_url('agentset/agentSetTags/changeinfo',array('id' => $tag['id'],'type'=>2))}" href="javascript:;" title="修改排序" data-toggle="ajaxEdit" >{$tag['sort']}</a></td>
                            <td>
                                <span class="change">
                                <span class='label {if $tag['enabled']==1}label label-primary {else}label-default{/if}'
                                    data-toggle='ajaxSwitch'
                                    data-switch-value='{$tag['enabled']}'
                                    data-switch-value0='0|隐藏|label label-default|{php echo web_url('agentset/agentSetTags/changeinfo',array('type'=>3,'value'=>1,'id'=>$tag['id']))}'
                                    data-switch-value1='1|显示|label label-primary|{php echo web_url('agentset/agentSetTags/changeinfo',array('type'=>3,'value'=>0,'id'=>$tag['id']))}'>
                                    {if $tag['enabled']==1}显示{else}隐藏{/if}
                                </span>
                                </span>
                            </td>
                            <td>{if $tag['type'] == 0}商户标签{else if $tag['type'] == 1}抢购标签{else if $tag['type'] == 2}拼团标签{else if $tag['type'] == 3}团购标签{else if $tag['type'] == 4}砍价标签{/if}</td>
                            <td>
                                <a href="{php echo web_url('agentset/agentSetTags/tagsedit',array('id'=>$tag['id']))}" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="修改"><i class="fa fa-edit"></i></a>
                                <a data-toggle="ajaxRemove" href="{php echo web_url('agentset/agentSetTags/changeinfo',array('type'=>4,'id'=>$tag['id']));}" data-confirm='确认删除此标签？' class="btn btn-default btn-sm" ><i class="fa fa-times"></i></a>
                            </td>
                        </tr>
                        {/loop}
                    </tbody>
                </table>
            </div>
            <div class="app-table-foot clearfix">
                <div class="pull-left">

                </div>
                <div class="pull-right">
                    {$pager}
                </div>
            </div>
        </div>
    </div>
</div>
{php include wl_template('common/footer');}